package com.aqie.medium.dynamicProgram;

/**
 * 338 比特位计数
 * todo 看下其他人解法
 */
public class CountBits {
    public int[] countBits(int num) {
        int[] nums = new int[num + 1];
        for (int i = 0; i <= num; i++){
            nums[i] = Integer.bitCount(i);
        }
        return nums;
    }
}
